@isTest
private class UpsertSaleTaxRESTTest {
    static testMethod void testMethod1() {
        
		
		Product__c p = TestUtils.createProduct();
		p.pk_invbasdoc__c = '0001C210000000000MYQ';

		insert p;

		Price__c pr = TestUtils.createPrice();
		pr.Product__c = p.Id;
		insert pr;

		Test.startTest();
		//测试
		List<UpsertSaleTaxREST.SaleRestArgs> args = new List<UpsertSaleTaxREST.SaleRestArgs>();
		UpsertSaleTaxREST.upsertSaletax(args);

		UpsertSaleTaxREST.SaleRestArgs arg1 = new UpsertSaleTaxREST.SaleRestArgs();
		arg1.pk_invbasdoc = '0001C210000000000MYQ';//产品编码
        arg1.def2 = '17'; //产品名称
        arg1.pk_invmandoc = '0001C210000000001XYD'; //规格
        arg1.unitcode = 'MKSY'; //型号
		args.add(arg1);
		
		UpsertSaleTaxREST.SaleRestArgs arg2 = new UpsertSaleTaxREST.SaleRestArgs();
		arg2.pk_invbasdoc = '0001C210000000000MZ0';//产品编码
        arg2.def2 = '17'; //产品名称
        arg2.pk_invmandoc = '0001C210000000001XYI'; //规格
        arg2.unitcode = 'MKSY'; //型号
		args.add(arg2);
		
		UpsertSaleTaxREST.upsertSaletax(args);
		
		UpsertSaleTaxREST.SaleRestArgs arg3 = new UpsertSaleTaxREST.SaleRestArgs();
		arg3.pk_invbasdoc = '0001C210000000000MZ1';//产品编码
        arg3.def2 = '17'; //产品名称
        arg3.pk_invmandoc = '0001C210000000001XYX'; //规格
        arg3.unitcode = 'MKSD'; //型号
		args.add(arg3);
		
		UpsertSaleTaxREST.upsertSaletax(args);
		Test.stopTest();
    }
}